package com.xingyang.manager.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xingyang.manager.AccountManager;

import com.xingyang.mapper.AccountMapper;
import com.xingyang.model.AccountDO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 信仰
 * @since 2023-11-23
 */
@Component
@Slf4j
public class AccountManagerImpl implements AccountManager {

    @Autowired
    private AccountMapper accountMapper;

    @Override
    public int insert(AccountDO accountDO) {


        return accountMapper.insert(accountDO);

    }

    @Override
    public List<AccountDO> findByPhone(String phone) {

        List<AccountDO> accountList = accountMapper.selectList(new QueryWrapper<AccountDO>().eq("phone", phone));

        return accountList;
    }
}
